/*!
 * \file Outcome.cc
 * \brief Définition des méthodes sur les Outcomes
 * \author AMMAR Inès (Responsable), CARBONNEL Jessie (Relecture)
 * \version 1.0
 * \date 01 mars 2013
 */

#include "Outcome.h"

#include <string>
#include <iostream>
#include <vector>
#include <stdarg.h>

using namespace std;

Outcome::Outcome(){}

void Outcome::addValue(string val){
	values.push_back(val);
}

vector<string> Outcome::getValues()const{
    return values;
}

string Outcome::getValue(int i)const{
    if(i>=0 && i<(int)values.size()){
        return values[i];
    }
}

int Outcome::getNumberOfValues()const{
    return values.size();
}

bool Outcome::isPresent(string val)const{
    for(int i(0);i<(int)values.size();++i){
        if (values[i] == val){
            return true;
        }
    }
    return false;
}

bool Outcome::valide(std::string v)const{
	return isPresent(v);
}

bool Outcome::valide(std::string v1, std::string v2)const{
	if(isPresent(v1) && isPresent(v2)) return true;
	else return false;
}

void Outcome::show()const{
    cout<<"{";
    for (int i = 0; i<(int)values.size();i++){
        cout<<values[i];
		if(i!=(int)values.size()-1) cout<<", ";
    }
    cout<<"}"<<endl;
}

